<!-- extend from base layout -->
{% extends "base.html" %}
{% block content %}
<link href="//v3.bootcss.com/examples/signin/signin.css" rel="stylesheet">
<div class="container">
  <form class="form-signin" action="/index" method="POST" name="login">
	{{form.csrf_token}}
	<h2 class="form-signin-heading">学生预约系统</h2>
	<label for="inputEmail" class="sr-only">Email address</label>
	<input class="form-control" type="text" name="StuID" required="" autofocus="" placeholder="学号">
	<label for="inputPassword" class="sr-only">Password</label>
	<input class="form-control" type="password" name="Password" required="" placeholder="密码">
	<button class="btn btn-lg btn-primary btn-block" type="submit">预约</button>
	{% with messages = get_flashed_messages() %}
  	{% if messages|length > 0%}
  	<div class="alert alert-danger" role="alert">
  	{{messages[-1]}}
  	</div>
  	{% endif %}
  	{% endwith %}
  	{% if computer %}
  	<div class="alert alert-info" role="alert">
  		预约成功！<br>
  		机器号：{{computer['ComputerID']}}<br>
  		机房号：{{computer['RoomID']}}
  	</div>
  	{% endif %}
  </form>
	</div> <!-- /container -->

<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="http://v3.bootcss.com/assets/js/ie10-viewport-bug-workaround.js"></script>
{% endblock %}